In [1]:
%matplotlib notebook
import convis


/home/jacob_unencrypted/Environments/default/local/lib/python2.7/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters

The convis.samples module contains a few general purpose stimuli and convis.kernels contains convolution kernels.

Sample Stimuli


In [2]:
stim = convis.samples.pulse(t=2000,x=20,y=20,pulse_length=100)
convis.animate_to_video(stim,scrolling_plot=True,window_length=1000)


Out[2]:

In [3]:
stim = convis.samples.chirp(t=2000, x=20, y=20,
                            pulse_on=500, pulse_off=1000,
                            amp_on=1500, amp_off=2500, amp_freq=5.0, amp_1=0.0, amp_2=1.0,
                            freq_on=3000, freq_off=4000, freq_1=0.1, freq_2=10.0,
                            stimulus_off=4500)
convis.animate_to_video(stim,scrolling_plot=True,window_length=1000)


Out[3]:

In [4]:
stim = convis.samples.moving_grating(t=2000, x=20, y=20, vt=0.005, vx=3.0, vy=2.0, p=0.01)
convis.animate_to_video(stim,scrolling_plot=True,window_length=1000)


Out[4]:

In [5]:
stim = convis.samples.moving_bar(t=2000, x=20, y=20,
                                 bar_pos=-1.0,
                                 bar_direction=0.0,
                                 bar_width=1.0,
                                 bar_v=0.01)
convis.animate_to_video(stim,scrolling_plot=True,window_length=1000)


Out[5]:

In [6]:
stim = convis.samples.random_checker_stimulus(t=2000, x=20, y=20, checker_size=5, seed=123)
convis.animate_to_video(stim,scrolling_plot=True,window_length=1000)


Out[6]:

Kernels


In [19]:
print '\n'.join(filter(lambda x: not x.startswith('_'), dir(convis.kernels)))


exponential_filter_1d
exponential_filter_5d
exponential_highpass_filter_1d
exponential_highpass_filter_5d
gabor_kernel
gauss_filter_2d
gauss_filter_3d
gauss_filter_5d
text_kernel

In [8]:
kernel = convis.kernels.gabor_kernel(phi=2.0, size=16, resolution=2.0, f=10.0, phase=0.0, sigma_x=1, sigma_y=1)
convis.describe(kernel)


Out[8]:
Numpy array (16, 16)

In [9]:
kernel = convis.kernels.text_kernel()
convis.describe(kernel)


Out[9]:
Numpy array (16, 16)

In [10]:
kernel = convis.kernels.exponential_filter_1d(tau=0.01,
                                                        n=0,
                                                        normalize=True)
convis.describe(kernel)


Out[10]:
Numpy array (47,)

In [11]:
kernel = convis.kernels.exponential_highpass_filter_1d()
convis.describe(kernel)


Out[11]:
1.0 (1,)

In [12]:
kernel = convis.kernels.gauss_filter_2d(0.1,0.1)
convis.describe(kernel)


Out[12]:
Numpy array (7, 7)

In [ ]: